package com.ltmonitor.service.impl;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ltmonitor.dao.ITerminalVideoPropertyDao;
import com.ltmonitor.video.entity.TerminalVideoProperty;
import com.ltmonitor.service.ITerminalVideoPropertyService;

/**
 * 终端音视频属性 入库
 */
@Service("terminalVideoPropertyService")
public class TerminalVideoPropertyService extends BaseService<Long, TerminalVideoProperty> implements ITerminalVideoPropertyService {

	@Autowired
	private ITerminalVideoPropertyDao TerminalVideoPropertyDao;


	/**
	 * 获得车辆终端的音视频属性
	 * @param vehicleId
	 * @return
	 */
	public TerminalVideoProperty getTerminalVideoPropertyByVehicleId(long vehicleId)
	{
		String hql = "from TerminalVideoProperty where vehicleId = ?";
		TerminalVideoProperty t = this.baseDao.find(hql, vehicleId);
		return t;
	}

	/**
	 * 下发获取命令，根据命令Id,获得车辆终端的音视频属性
	 * @param commandId 下发的终端命令id
	 * @return
	 */
	public TerminalVideoProperty getTerminalVideoPropertyByCommandId(long commandId)
	{
		String hql = "from TerminalVideoProperty where commandId = ?";
		TerminalVideoProperty t = this.baseDao.find(hql, commandId);
		return t;
	}

}
